package Prototype.Simple;

public class Client {
    public static void main(String[] args) {
        MyFruit fruit1,fruit2;
        fruit1 = new Apple();
        fruit2 = fruit1;

        fruit1.display();
        fruit2.display();
        System.out.println("浅拷贝:");
        System.out.println("fruit1==fruit2为"+(fruit1==fruit2));
        System.out.println("1:"+fruit1.hashCode());
        System.out.println("2:"+fruit2.hashCode());

        MyFruit fruit3 = (MyFruit)fruit1.clone();
        fruit1.display();
        fruit3.display();
        System.out.println("深拷贝:");
        System.out.println("fruit1==fruit3为"+(fruit1==fruit3));
        System.out.println("1:"+fruit1.hashCode());
        System.out.println("3:"+fruit3.hashCode());


    }
}
